import React, { Component } from 'react'
import axios from "axios"

export default class App extends Component {
    getList = () => {
        axios.get("http://localhost:3000/api5000/students").then((res) => {
            console.log(res.data)
        }).catch(err => err)
    }
    getCarList = () => {
        axios.get("http://localhost:3000/api5001/cars").then(res => {
            console.log(res.data)
        })
    }
    render() {
        return (
            <div>
                <button onClick={this.getList}>点我获取数据</button>
                <button onClick={this.getCarList}>点我获取汽车数据</button>
            </div>
        )
    }
}
